preserve
	use "$input_dir\susp_by_date.dta", clear	
	
	*quiet{
		keep if inlist(grade,"5")
		
		gen exp_capped_squared = exp_capped * exp_capped
	
		label var nothreat "Unmonitored Day"
		label var exp_capped "Experience"
		label var exp_capped_squared "Experience Squared"
		label var susp "Suspension Issued"
		
		egen _id_year = concat(id year)
		
		local j = 1
		eststo clear
		estimates clear
		
		eststo model`j': reghdfe susp nothreat, absorb(sch_id id) cluster(id#year)
		distinct id if e(sample)
		estadd scalar _ndistinct = r(ndistinct)
		quietly: sum susp if e(sample), meanonly
		estadd scalar _meanoutcome = r(mean)
		local ++j
		
		eststo model`j': reghdfe susp nothreat, absorb(dates sch_id id) cluster(id#year)
		distinct id if e(sample)
		estadd scalar _ndistinct = r(ndistinct)
		quietly: sum susp if e(sample), meanonly
		estadd scalar _meanoutcome = r(mean)
		local ++j
		
		eststo model`j': reghdfe susp nothreat exp_capped exp_capped_squared, absorb(dates sch_id id) cluster(id#year)
		distinct id if e(sample)
		estadd scalar _ndistinct = r(ndistinct)
		quietly: sum susp if e(sample), meanonly
		estadd scalar _meanoutcome = r(mean)
		local ++j
		
		*}


	* prepare estimates for estout
	estfe model*, labels(sch_id "School FE" dates "Date FE" trace "Teacher Race" grade "Grade FE" id "Teacher FE")
	return list
	
	
	* 
	esttab model* using "$output_dir\Tables\_Table_19.tex" , replace ///
		indicate(`r(indicate_fe)' "Experience = *xp*", label("X" " ")) ///
		noomitted nobase se label ///
		keep(nothreat) noobs ///
		nonotes $stars starlevels(\$^+\$ 0.10 * 0.05 ** 0.01 *** 0.001) ///
		scalars("_meanoutcome Average Daily Suspension Rate" "_ndistinct Teachers")
		
	* return stored estimates to their previous state
	estfe model*, restore

restore
